<script lang="ts" setup>
import { defineProps, defineEmits } from 'vue';

const props = defineProps<{
  todoInputValue: string;
}>();

const emits = defineEmits<{
  (e: 'update:todoInputValue', value: string): void;
  (e: 'addTodo'): void;
}>();

</script>

<template>
  <div class="todo-list-input">
    <input 
      :value="props.todoInputValue"
      @input="(e: any) => emits('update:todoInputValue', e?.target?.value)"
      type="text" placeholder="请输入待办事项"  @keydown.enter="emits('addTodo')"/>
  </div>
</template>